<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>3570：DZY Loves Physics I</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">DZY Loves Physics I</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">DZY Loves Physics I</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                DZY Loves Physics I                </h1>
                <p>时间限制：10s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：256MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><div><span style="font-size: medium">背景</span></div>
<div><span style="font-size: medium">众所周知，DZY是个大学霸，精通数理化。有天，吉丽拿着一道物理题目去问DZY，DZY很快就秒了这题，但是懒得算了，就让你来解决它。</span></div>
<div><span style="font-size: medium"><br />
</span></div>
<div><span style="font-size: medium">题目描述</span></div>
<div><span style="font-size: medium">现在水平面上有一条无限长的光滑轨道，上面有n个小球(体积忽略)，每个小球的质量都相同。现在这些小球在某些神奇的力量下开始了运动。 给定一个常数C, 每个小球在任意时刻的速度v和加速度a均满足a*v=C.&nbsp;</span></div>
<div><span style="font-size: medium">吉丽还规定，在任意时刻，每个小球的加速度a和速度v方向相同。</span></div>
<div><span style="font-size: medium"><br />
</span></div>
<div><span style="font-size: medium">因为有多个小球的存在，在运动中，小球之间可能发生碰撞，这里假设小球间发生的碰撞均为完全弹性碰撞。&nbsp;</span></div>
<div><span style="font-size: medium">吉丽还会给你常数C，每个小球最开始的位置，运动方向，以及初速度Vi.</span></div>
<div><span style="font-size: medium">吉丽的询问是这样的： 给你整数T,K, 让你求当前系统中，让小球开始运动T时刻后，速率第K小的小球的速率为多少。</span></div>
<div><span style="font-size: medium">注意，每次询问之后，小球回到原位。</span></div>
<div><span style="font-size: medium"><br />
</span></div>
<div><span style="font-size: medium">当然，为了考察你的随机应变能力，吉丽会在问问题的时候不时地增加新的小球。</span></div>
<div><span style="font-size: medium"><br />
</span></div>
<div></div>
<p></p></p><hr/><h3>输入格式</h3><p><div></div>
<div>
<div><span style="font-size: medium">第一行包含两个正整数n,C.&nbsp;</span></div>
<div><span style="font-size: medium">接下来n行，每行包含三个整数Vi,Xi,Di</span></div>
<div><span style="font-size: medium">Vi代表第i个小球的速率</span></div>
<div><span style="font-size: medium">Xi代表第i个小球的初始位置(你可以想象轨道是一个数轴)</span></div>
<div><span style="font-size: medium">Di代表第i个小球的初始运动方向 其中1表示正方向，-1表示反方向。</span></div>
<div><span style="font-size: medium">接下来一行Q 代表操作的个数</span></div>
<div><span style="font-size: medium">接下来Q行，第一个数为操作的种类tp</span></div>
<div><span style="font-size: medium">0 Vj Xj Dj 代表吉丽增加了一个初速度Vj, 位置Xj， 运动方向Dj的小球</span></div>
<div><span style="font-size: medium">1 T K 代表吉丽的一次询问</span></div>
<div><span style="font-size: medium"><br />
</span></div>
<div></div>
</div>
<div>
<p></p>
</div></p><hr/><h3>输出格式</h3><p><div></div>
<div>
<div><span style="font-size: medium">对于每一个询问，输出一行包含一个实数，代表答案。 保留3位小数。</span></div>
<div><span style="font-size: medium"><br />
</span></div>
<div><span style="font-size: medium">数据范围</span></div>
<div><span style="font-size: medium">n,m&lt;=10^5 Vi&lt;=10^5 |Xi|&lt;=10^9 0&lt;C&lt;=10^9 0&lt;=T&lt;=10^5&nbsp;</span></div>
<div><span style="font-size: medium">保证数据合法</span></div>
<div><span style="font-size: medium"><br />
</span></div>
<div></div>
</div>
<div>
<p></p>
</div></p><hr/><h3>样例输入</h3><pre>3 10
1 2 1
3 4 1
6 5 1
3
1 5 1
0 8 -5 -1
1 8 2

</pre><hr/><h3>样例输出</h3><pre>10.050
13.000

</pre><hr/><h3>提示</h3><p><p><span style="font-size: medium">n,Q&lt;=10^5 Vi&lt;=10^5 |Xi|&lt;=10^9 0&lt;C&lt;=10^9 0&lt;=T&lt;=10^5&nbsp;</span></p></p><hr/><h3>题目来源</h3><p>By AcrossTheSky
</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=3570" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=3570" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>